package com.atguigu.jedis;

import redis.clients.jedis.Jedis;

/**
 * Created by Smexy on 2022/11/7
 */
public class Demo1
{
    public static void main(String[] args) {

        //创建客户端，连接服务端
        Jedis jedis = new Jedis("hadoop102", 6379);
        //准备命令
        jedis.set("s1","jedis");
        jedis.lpush("list1","1","2","3","3");
        jedis.sadd("set1","a","a","b","c");
        jedis.hset("hash1","name","jack");
        jedis.zadd("zset1",100d,"蔡徐坤");

        System.out.println(jedis.get("s1"));
        System.out.println(jedis.lrange("list1",0,-1));
        System.out.println(jedis.smembers("set1"));
        System.out.println(jedis.hgetAll("hash1"));
        System.out.println(jedis.zrange("zset1",0,-1));
        //发送命令，如果是读取，接收返回值

        //关闭连接
        jedis.close();

    }
}
